/**
 * Copyright (C), 2018-2018, https://blog.fundodoo.com
 * Author:   醉探索戈壁
 * Date:     2018/6/25 下午7:08
 * Description: 测试日志的定时任务
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.fundodoo.blog.drunk4.logsecheduling;

import lombok.extern.log4j.Log4j2;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 *
 * @author 醉探索戈壁
 * @create 2018/6/25 下午7:08
 * @since 1.0.0
 */
@Component
@Log4j2
public class DrunkLog {

    @Scheduled(fixedRate = 1*1000)
    public void wingsLog(){
        Date now = new Date();
        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
        log.info(dateFormat.format(now));
        log.debug("-------DEBUG---------");
        log.warn(System.currentTimeMillis());
        log.error(now.getTime());
    }
}
